﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YServer
{
    public class ObjectPool<T>where T:new()
    {
        //int maxNum;
        Stack<T> stack;

        public int Count{
            get { return stack.Count; }
        }

        public ObjectPool(int max=30){
            //maxNum = max;
            stack = new Stack<T>(max);
        }

        public void Push(T item) {
            stack.Push(item);
        }

        public T Pop() {
            return stack.Pop();
        }
    }
}
